<?php

require_once ROOT . 'server/classes/arquitetura/entity/AbstractEntity.class.php';

class Categoria extends AbstractEntity {

    private $id;
    private $nome;
    private $insertDate;
    private $updateDate;

    /**
     * Default Constructor.
     */
    public function __construct() {
        
    }

    /* Este atributo eh int(11) */

    public function setId($id) {
        $this->id = $id;
    }

    public function getId() {
        return $this->id;
    }

    /* Este atributo eh varchar(30) */

    public function setNome($nome) {
        $this->nome = $nome;
    }

    public function getNome() {
        return $this->nome;
    }

    /* Este atributo eh timestamp */
    public function setInsertDate($insertDate) {
        $this->insertDate = $insertDate;
    }

    public function getInsertDate() {
        return $this->insertDate;
    }

    /* Este atributo eh timestamp */
    public function setUpdateDate($updateDate) {
        $this->updateDate = $updateDate;
    }

    public function getUpdateDate() {
        return $this->updateDate;
    }

    public function __toString() {
        return $this->getNome();
    }

    public function equals($obj) {
        if (empty($obj)) {
            return false;
        }
        if ($this->getId() == $obj->getId() && $this->getNome() == $obj->getNome()) {
            return true;
        }
        return false;
    }

    public function cloneMe() {
        $newCategoria = new Categoria();
        $newCategoria->setId($this->getId());
        $newCategoria->setNome($this->getNome());
        $newCategoria->setInsertDate($this->getInsertDate());
        $newCategoria->setUpdateDate($this->getUpdateDate());
        return $newCategoria;
    }

}

?>
